package com.vcms.cms.entity;

import java.sql.Timestamp;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * ContentExt entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "content_ext", catalog = "vcms_0.1")
public class ContentExt implements java.io.Serializable {

	// Fields

	private Integer contentExtId;
	private Content content;
	private String title;
	private String shortTitle;
	private String author;
	private String origin;
	private String originUrl;
	private String description;
	private Timestamp releaseDate;
	private String mediaPath;
	private String mediaType;
	private String titleColor;
	private Boolean isBold;
	private String titleImg;
	private String contentImg;
	private String typeImg;
	private String link;
	private String tplContent;
	private Boolean needRegenerate;
	private Set<Content> contents = new HashSet<Content>(0);

	// Constructors

	/** default constructor */
	public ContentExt() {
	}

	/** full constructor */
	public ContentExt(Content content, String title, String shortTitle,
			String author, String origin, String originUrl, String description,
			Timestamp releaseDate, String mediaPath, String mediaType,
			String titleColor, Boolean isBold, String titleImg,
			String contentImg, String typeImg, String link, String tplContent,
			Boolean needRegenerate, Set<Content> contents) {
		this.content = content;
		this.title = title;
		this.shortTitle = shortTitle;
		this.author = author;
		this.origin = origin;
		this.originUrl = originUrl;
		this.description = description;
		this.releaseDate = releaseDate;
		this.mediaPath = mediaPath;
		this.mediaType = mediaType;
		this.titleColor = titleColor;
		this.isBold = isBold;
		this.titleImg = titleImg;
		this.contentImg = contentImg;
		this.typeImg = typeImg;
		this.link = link;
		this.tplContent = tplContent;
		this.needRegenerate = needRegenerate;
		this.contents = contents;
	}

	// Property accessors
	@Id
	@GeneratedValue
	@Column(name = "contentExtId", unique = true, nullable = false)
	public Integer getContentExtId() {
		return this.contentExtId;
	}

	public void setContentExtId(Integer contentExtId) {
		this.contentExtId = contentExtId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "contentId")
	public Content getContent() {
		return this.content;
	}

	public void setContent(Content content) {
		this.content = content;
	}

	@Column(name = "title", length = 300)
	public String getTitle() {
		return this.title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	@Column(name = "shortTitle", length = 200)
	public String getShortTitle() {
		return this.shortTitle;
	}

	public void setShortTitle(String shortTitle) {
		this.shortTitle = shortTitle;
	}

	@Column(name = "author", length = 100)
	public String getAuthor() {
		return this.author;
	}

	public void setAuthor(String author) {
		this.author = author;
	}

	@Column(name = "origin", length = 200)
	public String getOrigin() {
		return this.origin;
	}

	public void setOrigin(String origin) {
		this.origin = origin;
	}

	@Column(name = "originUrl", length = 300)
	public String getOriginUrl() {
		return this.originUrl;
	}

	public void setOriginUrl(String originUrl) {
		this.originUrl = originUrl;
	}

	@Column(name = "description", length = 500)
	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@Column(name = "releaseDate", length = 19)
	public Timestamp getReleaseDate() {
		return this.releaseDate;
	}

	public void setReleaseDate(Timestamp releaseDate) {
		this.releaseDate = releaseDate;
	}

	@Column(name = "mediaPath", length = 300)
	public String getMediaPath() {
		return this.mediaPath;
	}

	public void setMediaPath(String mediaPath) {
		this.mediaPath = mediaPath;
	}

	@Column(name = "mediaType", length = 20)
	public String getMediaType() {
		return this.mediaType;
	}

	public void setMediaType(String mediaType) {
		this.mediaType = mediaType;
	}

	@Column(name = "titleColor", length = 20)
	public String getTitleColor() {
		return this.titleColor;
	}

	public void setTitleColor(String titleColor) {
		this.titleColor = titleColor;
	}

	@Column(name = "isBold")
	public Boolean getIsBold() {
		return this.isBold;
	}

	public void setIsBold(Boolean isBold) {
		this.isBold = isBold;
	}

	@Column(name = "titleImg", length = 300)
	public String getTitleImg() {
		return this.titleImg;
	}

	public void setTitleImg(String titleImg) {
		this.titleImg = titleImg;
	}

	@Column(name = "contentImg", length = 300)
	public String getContentImg() {
		return this.contentImg;
	}

	public void setContentImg(String contentImg) {
		this.contentImg = contentImg;
	}

	@Column(name = "typeImg", length = 200)
	public String getTypeImg() {
		return this.typeImg;
	}

	public void setTypeImg(String typeImg) {
		this.typeImg = typeImg;
	}

	@Column(name = "link", length = 300)
	public String getLink() {
		return this.link;
	}

	public void setLink(String link) {
		this.link = link;
	}

	@Column(name = "tplContent", length = 100)
	public String getTplContent() {
		return this.tplContent;
	}

	public void setTplContent(String tplContent) {
		this.tplContent = tplContent;
	}

	@Column(name = "needRegenerate")
	public Boolean getNeedRegenerate() {
		return this.needRegenerate;
	}

	public void setNeedRegenerate(Boolean needRegenerate) {
		this.needRegenerate = needRegenerate;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "contentExt")
	public Set<Content> getContents() {
		return this.contents;
	}

	public void setContents(Set<Content> contents) {
		this.contents = contents;
	}

}